import request from '@/utils/request/index.js'

export default {
  addGoods(data) {
    return request({
      url: '/store/mini/goods/add',
      method: 'POST',
      data
    })
  },
  // 根据分类id查询商品
  getGoodsDetails(data) {
    return request({
      url: '/store/mini/goods/getGoodsByCategoryId',
      method: 'POST',
      data
    })
  },
  // 带货商品列表
  getSellGoodsList(data) {
    return request({
      url: '/store/mini/shopWindow/getSellGoodsList',
      method: 'POST',
      data
    })
  },
  // 查询系统默认商品分类
  getSystemCategory(params) {
    return request({
      url: '/store/mini/goods/getSystemCategory',
      method: 'GET',
      params
    })
  },
  // 查询用户商品分类
  getUserCategory(params) {
    return request({
      url: '/store/mini/goods/getUserCategory',
      method: 'GET',
      params
    })
  },
  // 查询用户分类(商品库)
  getCategoryByAccountId(params) {
    return request({
      url: '/store/mini/goods/getCategoryByAccountId',
      method: 'GET',
      params
    })
  },
  // 根据spuId查询商品
  getGoods(data) {
    return request({
      url: '/store/mini/goods/getGoodsBySpuId',
      method: 'GET',
      data
    })
  },
  // 根据spuId查询商品详情
  getByGoodsDetails(data) {
    return request({
      url: '/store/mini/goods/getGoodsDetailsBySpuId',
      method: 'GET',
      data
    })
  },
  // 根据橱窗Id查询商品详情
  getNewGoodsDetails(data) {
    return request({
      url: '/store/mini/goods/getGoodsDetailsPageBySpuId',
      method: 'GET',
      data
    })
  },
  // 删除商品
  deleteGoods(data) {
    return request({
      url: '/store/mini/goods/delete',
      method: 'GET',
      data
    })
  },
  // 商品上下架
  updateStatus(data) {
    return request({
      url: '/store/mini/goods/updateStatus',
      method: 'GET',
      data
    })
  },
  // 修改商品
  updateGoods(data) {
    return request({
      url: '/store/mini/goods/update',
      method: 'POST',
      data
    })
  },
  // 添加商品分类
  addCategory(data) {
    return request({
      url: '/store/mini/goods/addCategory',
      method: 'GET',
      data
    })
  },
  // 运营身份添加商品
  addOperatorsGoods(data) {
    return request({
      url: '/store/mini/goods/addOperatorsGoods',
      method: 'POST',
      data
    })
  },
  // 修改商品分类
  updateCategory(data) {
    return request({
      url: '/store/mini/goods/updateCategory',
      method: 'GET',
      data
    })
  },
  // 商品分类置顶
  topCategory(data) {
    return request({
      url: '/store/mini/goods/topCategory',
      method: 'GET',
      data
    })
  },
  // 删除商品分类
  deleteCategory(data) {
    return request({
      url: '/store/mini/goods/deleteCategory',
      method: 'GET',
      data
    })
  },
  // 查询商品标签
  getGoodsLabel(data) {
    return request({
      url: '/store/mini/goods/getGoodsLabel',
      method: 'POST',
      data
    })
  },
  // 添加商品标签
  addLabel(data) {
    return request({
      url: '/store/mini/goods/addLabel',
      method: 'GET',
      data
    })
  },
  // 删除商品标签
  deleteLabel(data) {
    return request({
      url: '/store/mini/goods/deleteLabel',
      method: 'GET',
      data
    })
  },
  // 查询规格项
  querySpec(data) {
    return request({
      url: '/store/mini/goods/querySpec',
      method: 'GET',
      data
    })
  },
  // 规格项
  goodsSpec(data) {
    return request({
      url: '/store/mini/goods/goodsSpec',
      method: 'POST',
      data
    })
  },
  // 添加购物车商品更新商品
  addOrUpdate(data) {
    return request({
      url: '/store/mini/shoppingCart/addOrUpdate',
      method: 'POST',
      data
    })
  },
  // 购物车列表
  getShoppingCart(data) {
    return request({
      url: '/store/mini/shoppingCart/getList',
      method: 'POST',
      data
    })
  },
  // 删除购物车商品
  delShoppingCart(data) {
    return request({
      url: '/store/mini/shoppingCart/del',
      method: 'POST',
      data
    })
  },
  // 橱窗添加删除
  updateShopWindow(data) {
    return request({
      url: '/store/mini/shopWindow/updateShopWindow',
      method: 'GET',
      data
    })
  },
  // 修改下级佣金比例
  setShopWindow(data){
    return request({
      url: '/store/mini/shopWindow/updateCommissionRatioLv2',
      method: 'GET',
      data
    })
  },
  // 选品广场列表(商品)
  getGoodsSquare(data){
    return request({
      url: '/store/mini/shopWindow/getGoodsSquare',
      method: 'POST',
      data
    })
  },
  // 获取橱窗列表
  getShopWindow(data){
    return request({
      url: '/store/mini/shopWindow/getShopWindow',
      method: 'POST',
      data
    })
  },
  // 选品广场列表(店铺)
  getStoreSquare(data){
    return request({
      url: '/store/mini/shopWindow/getStoreSquare',
      method: 'GET',
      data
    })
  },
  // 查询商品分类--上下游、可帮卖
  getSHCategory() {
    return request({
      url: '/store/mini/shopWindow/getHasHelpSellCategoryByAccountId',
      method: 'GET'
    })
  },
  // 商城分类--用户
  getStoreCategory() {
    return request({
      url: '/store/mini/shopWindow/getShoppingMallCategoryByAccountId',
      method: 'GET'
    })
  },
  // 商城列表
  getStoreList(data) {
    return request({
      url: '/store/mini/shopWindow/getShoppingMall',
      method: 'POST',
      data
    })
  },
  // 社群主页
  getShopCategory(data) {
    return request({
      url: '/store/mini/shopWindow/getShoppingByAccountId',
      method: 'GET',
      data
    })
  },
  // 供货详情的商品分类列表
  getGHCategory(data) {
    return request({
      url: '/store/mini/shopWindow/getHasHelpSellDetailsCategoryByAccountId',
      method: 'GET',
      data
    })
  }
}